//
//  UIBarButtonItem+Extension.swift
//  globalcarbusiness
//
//  Created by dongzhenyu on 2017/8/16.
//  Copyright © 2017年 dongzhenyu. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    
    convenience init(imageName: String, target: AnyObject?, action: Selector) {
        let btn = UIButton()
        btn.setImage(UIImage(named: imageName), for: .normal)
        btn.setImage((UIImage(named: imageName)), for: .highlighted)
        btn.addTarget(target, action: action, for: .touchUpInside)
        btn.sizeToFit()
        self.init(customView: btn)
    }
}
